package kr.co.sharping.Fragment;

import kr.co.sharping.R;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;

public abstract class Fragment_Tab3 extends Fragment implements
		OnCheckedChangeListener {

	public static final int ViewContainor = R.id.fragment_tab3_containor;
	private RadioGroup group_tab;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		View v = inflater.inflate(R.layout.fragment_tab3, null);
		group_tab = (RadioGroup) v.findViewById(R.id.fragment_select_tab_group);

		return v;
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);

		setTabChanged();
		setTabpage();
	}

	private void setTabpage() {
		SeletedTap(0);
		
	}

	private void setTabChanged() {
		group_tab.setOnCheckedChangeListener(this);
	}
	
	@Override
	public void onCheckedChanged(RadioGroup group, int checkedId) {
		switch (checkedId) {
		case R.id.fragment_select_tab1:
			SeletedTap(0);
			break;
		case R.id.fragment_select_tab2:
			SeletedTap(1);
			break;
		case R.id.fragment_select_tab3:
			SeletedTap(2);
			break;
		}
	}

	abstract public String[] getURL();

	abstract public void SeletedTap(int position);
}
